﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="System.Collections.Generic" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	导渗系统（每月）
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="dolphincontainer">
	    <div id="dolphinnav">
	        <ul class="top_tab">
                <li><a href="/Record/StackWater/<%=ViewData["id"] %>?date=<%=(DateTime)ViewData["originalDate"] %>&factoryId=<%=ViewData["factoryId"] %>"><span>水位及水质</span></a></li>
                <li><a href="/Record/BackWater/<%=ViewData["id"] %>?date=<%=(DateTime)ViewData["originalDate"] %>&factoryId=<%=ViewData["factoryId"] %>"><span>进浆及回水</span></a></li>
                <li><a href="/Record/Settle/<%=ViewData["id"] %>?date=<%=(DateTime)ViewData["originalDate"] %>&factoryId=<%=ViewData["factoryId"] %>"><span>沉降及位移</span></a></li>
                <li><a href="/Record/Ardealite/<%=ViewData["id"] %>?date=<%=(DateTime)ViewData["originalDate"] %>&factoryId=<%=ViewData["factoryId"] %>"><span>磷石膏堆积坝</span></a></li>
                <li><a href="/Record/Ditch/<%=ViewData["id"] %>?date=<%=(DateTime)ViewData["originalDate"]%>&factoryId=<%=ViewData["factoryId"] %>"><span>截洪沟</span></a></li>
                <li><a href="/Record/PiezometerWell/<%=ViewData["id"] %>?date=<%=(DateTime)ViewData["originalDate"]%>&factoryId=<%=ViewData["factoryId"] %>"><span>浸润线观测</span></a></li>
                <li><a href="/Record/PiezometerBase/<%=ViewData["id"] %>?date=<%=(DateTime)ViewData["originalDate"]%>&factoryId=<%=ViewData["factoryId"] %>"><span>渗压观测</span></a></li>
                <li><a href="javascript:return(false);" class="current"><span>导渗系统</span></a></li>
	        </ul>
	    </div>
	</div>

    <%
           bool result = (bool)ViewData["success"];
           if(result){ 
        %>
           <div class="tips_area">导渗系统更新成功</div>
        <%
        }
        %>

    <% using (Html.BeginForm())
    {
        Dictionary<Drain_system_basic_info, List<Drain_system_outlet_info>> drainOutlets = (Dictionary<Drain_system_basic_info, List<Drain_system_outlet_info>>)ViewData["drainOutlets"];
    %>

        <%= Html.ValidationSummary(true) %>
        <%= Html.Hidden("stack_id", ViewData["id"])%>
        <%= Html.Hidden("factoryId", ViewData["factoryId"]) %>
        <%= Html.Hidden("date", (DateTime)ViewData["date"])%>
        <%
           DateTime date = (DateTime)ViewData["date"];
        %>           
    
    <table cellpadding="4" cellspacing="0" class="com_from_table" style="width:900px;">
        <tr>
            <th colspan="2">导渗系统（每月 - <%= date.Year%>年<%=date.Month%>月）</th>
        </tr>
        
        <tr>
            <td class="lab" style="width:138px;">测量人员：</td>
            <td style="width:608px;">
                <%= Html.DropDownList("tester_id", ViewData["users"] as List<SelectListItem>, "请选择", new { style = "width:150px" })%>
            </td>
        </tr>

    </table>

    
    <% if (drainOutlets != null && drainOutlets.Count > 0)
        {
            int i = 1;
            foreach (KeyValuePair<Drain_system_basic_info, List<Drain_system_outlet_info>> drain in drainOutlets)
            {
                List<Drain_system_outlet_info> outlets = drain.Value;
                List<Drain_system_Monthly_info> outletRecords = (List<Drain_system_Monthly_info>)ViewData["drainRecords" + i];
                   
    %>
    <table cellpadding="4" cellspacing="0" class="com_from_table" style="margin-top:8px;"  style="width:900px;">
        <tr>
            <td colspan="2">
            
                <p style="vertical-align:middle; padding-left:1em;">
                    <strong>El.<%=drain.Key.El %>m 高程导渗系统监测表<%if (!string.IsNullOrEmpty(drain.Key.Pic_filepath)){ %></strong> <a href="<%=Url.Content(drain.Key.Pic_filepath) %>" target="_blank">(查看导渗系统出水口)</a><%} %>
                </p>

                <table cellpadding="4" cellspacing="0" border="0" width="100%" class="subtable2">
                    
                    <tr>
                        <th style="width:60px; text-align:center;">组别</th>
                        <th style="width:75px; text-align:center;">出水口编号</th>
                        <th style="width:75px; text-align:center;">对应导渗段</th>
                        <th style="width:150px; text-align:center;">是否为导渗段仅有出水口</th>
                        <th style="width:130px; text-align:center;">是否为溢流出水口</th>
                        <th style="width:130px; text-align:center;">测量流量（m<sup>3</sup>/sec）</th>
                        <th style="width:100px; text-align:center;">出水颜色</th>
                        <th style="width:80px; text-align:center;">结垢状况</th>
                        <th>备注</th>
                    </tr>

                    <%
                        if (outlets != null & outlets.Count > 0)
                        {
                            for (int j = 0; j < outlets.Count; j++)
                            {
                                bool hasRecord = outletRecords != null && outletRecords.Count > j;
                    %>
                    <tr>
                        <td style="text-align:center;"><%=outlets[j].Drain_outlet_group_no%></td>
                        <td style="text-align:center;"><%=outlets[j].Drain_outlet_no%></td>
                        <td style="text-align:center;"><%=outlets[j].Drain_outlet_section_no%></td>
                        <td style="text-align:center;"><%=(outlets[j].Is_sole_outlet.HasValue && outlets[j].Is_sole_outlet.Value == 1 ? "是" : "")%></td>
                        <td style="text-align:center;"><%=(outlets[j].Is_seepage_outlet.HasValue && outlets[j].Is_seepage_outlet.Value == 1 ? "是" : "")%></td>
                        <td><input type="text" size="5" name="Rate_Of_Flow_<%=i %>_<%=outlets[j].Drain_outlet_no %>" value="<%if (hasRecord && outletRecords[j].Rate_Of_Flow.HasValue){%><%=outletRecords[j].Rate_Of_Flow.Value.ToString()%><%}%>" /></td>
                        <td style="text-align:center;">
                            <select name="Color_of_Flow_<%=i %>_<%=outlets[j].Drain_outlet_no %>">
                                <option value="1" <%= hasRecord && outletRecords[j].Color_of_Flow.HasValue && outletRecords[j].Color_of_Flow.Value == 1 ? "selected" : "" %>>正常</option>
                                <option value="2" <%= hasRecord && outletRecords[j].Color_of_Flow.HasValue && outletRecords[j].Color_of_Flow.Value == 2 ? "selected" : "" %>>略微混浊</option>
                                <option value="3" <%= hasRecord && outletRecords[j].Color_of_Flow.HasValue && outletRecords[j].Color_of_Flow.Value == 3 ? "selected" : "" %>>混浊</option>
                                <option value="4" <%= hasRecord && outletRecords[j].Color_of_Flow.HasValue && outletRecords[j].Color_of_Flow.Value == 4 ? "selected" : "" %>>严重混浊</option>
                            </select>
                        </td>
                        <td style="text-align:center;">
                            <select name="Deposit_<%=i %>_<%=outlets[j].Drain_outlet_no %>">
                                <option value="1" <%= hasRecord && outletRecords[j].Deposit.HasValue && outletRecords[j].Deposit.Value == 1 ? "selected" : "" %>>无</option>
                                <option value="2" <%= hasRecord && outletRecords[j].Deposit.HasValue && outletRecords[j].Deposit.Value == 2 ? "selected" : "" %>>轻微</option>
                                <option value="3" <%= hasRecord && outletRecords[j].Deposit.HasValue && outletRecords[j].Deposit.Value == 3 ? "selected" : "" %>>典型</option>
                                <option value="4" <%= hasRecord && outletRecords[j].Deposit.HasValue && outletRecords[j].Deposit.Value == 4 ? "selected" : "" %>>严重</option>
                            </select>
                        </td>
                        <td style="color:red;"><%=outlets[j].Is_In_Normal_Use.HasValue && outlets[j].Is_In_Normal_Use.Value != 1 ? "(※)" : ""%></td>
                    </tr>
                    <%
                            }
                        }
                    %>

                </table>

            </td>
        </tr>
    </table>
    <%
                i++;
            }
        }
    %>
    
    
    <input type="hidden" name="drainNum" value="<%=drainOutlets != null ? drainOutlets.Count : 0 %>" />
    <div class="submit_btn_area" style=" margin-left:152px;">
        <input type="submit" value="提 交" />
    </div>

    <% } %>
</asp:Content>
